package me.jenwang.unittest.example.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;

/**
 * @author <a href=mailto://wq163@163.com>jenwang</a>
 * @since 2014-9-18
 **/

public abstract class BaseJdbcTemplateDAO {
    protected JdbcTemplate jt;


    @Autowired
    @Lazy
    public void setDataSource(final DataSource dataSource) {
        this.jt = new JdbcTemplate(dataSource);
    }


    //for unit test only
    protected void replaceJtForTest() {
    }
}
